//
//  WZXFindOneDetailTableViewCell.m
//  WWLNetease
//
//  Created by dllo on 15/12/30.
//  Copyright © 2015年 Echo.Jobs. All rights reserved.
//

#import "WZXFindOneDetailTableViewCell.h"

@implementation WZXFindOneDetailTableViewCell


- (instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self createSubViews];
    }
    
    return self;
}

- (void)createSubViews {
#pragma mark - 提问的头像
    self.headImageTW = [[UIImageView alloc] init];
    self.headImageTW.layer.masksToBounds = YES;//裁掉边界
    self.headImageTW.layer.cornerRadius = 15;//设置半径
    [self.contentView addSubview:self.headImageTW];
    
    [self.headImageTW mas_remakeConstraints:^(MASConstraintMaker *make) {
       
        make.left.equalTo(self.contentView.mas_left).offset(10);
        make.top.equalTo(self.contentView.mas_top).offset(5);
        make.size.mas_equalTo(CGSizeMake(30, 30));
    }];
    
 
#pragma mark - 提问的名字
    self.nameLabelTW = [[UILabel alloc] init];
//    self.nameLabelTW.textAlignment = NSTextAlignmentCenter;
    self.nameLabelTW.font = [UIFont systemFontOfSize:14];
    [self.contentView addSubview:self.nameLabelTW];
    
    [self.nameLabelTW mas_remakeConstraints:^(MASConstraintMaker *make) {
       
        make.left.equalTo(self.headImageTW.mas_left).offset(35);
        make.top.equalTo(self.headImageTW.mas_top).offset(2.5);
        make.width.equalTo(self.contentView.mas_width).multipliedBy(0.7);
        make.height.mas_equalTo(20);
        
    }];
    
#pragma mark - 提问者的提问
    self.questionLabelTW = [[UILabel alloc] init];
//    self.questionLabelTW.textAlignment = NSTextAlignmentCenter;
    self.questionLabelTW.font = [UIFont systemFontOfSize:14];
    self.questionLabelTW.numberOfLines = 0;
    [self.contentView addSubview:self.questionLabelTW];
    [self.questionLabelTW mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.headImageTW.mas_left).offset(35);
        make.top.equalTo(self.headImageTW.mas_top).offset(25);
        make.width.equalTo(self.contentView.mas_width).multipliedBy(0.7);
       
        
    }];


    
    
    
 /*********    **************/
    
  
#pragma mark - 专家的头像
    self.headImageHD = [[UIImageView alloc] init];
    self.headImageHD.layer.masksToBounds = YES;//裁掉边界
    self.headImageHD.layer.cornerRadius = 10;//设置半径
    [self.contentView addSubview:self.headImageHD];
    
#pragma mark - 提问的名字
    self.nameLabelHD = [[UILabel alloc] init];
    //    self.nameLabelTW.textAlignment = NSTextAlignmentCenter;
    self.nameLabelHD.backgroundColor = [UIColor redColor];
    self.nameLabelHD.font = [UIFont systemFontOfSize:14];
    [self.contentView addSubview:self.nameLabelHD];
    
#pragma mark - 回答者的回答
    self.answerLabelHD = [[UILabel alloc] init];
    //    self.answerLabelHD.textAlignment = NSTextAlignmentCenter;
    self.answerLabelHD.backgroundColor = [UIColor redColor];
    self.answerLabelHD.font = [UIFont systemFontOfSize:14];
    self.answerLabelHD.numberOfLines = 0;
    [self.contentView addSubview:self.answerLabelHD];
    
#pragma mark - 时间
    self.timeLabel = [[UILabel alloc] init];
    self.timeLabel.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:self.timeLabel];
    
    
}

-(void)setQuesModel:(WZXQuextionModel *)quesModel {
    _quesModel = quesModel;

    [self.headImageTW sd_setImageWithURL:[NSURL URLWithString:self.quesModel.userHeadPicUrl] placeholderImage:nil];
    self.questionLabelTW.text = _quesModel.content;
    self.nameLabelTW.text = _quesModel.userName;
    
    
}

- (void)setAnswerModel:(WZXAnswerModel *)answerModel {
    
    
    
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
